package whf.framework.util.var;

import java.util.Map;

import whf.framework.util.Sequence;

/**
 * 获取序列的变量
 * @author wanghaifeng
 *
 */
public class SequenceVariableHolder implements VariableHolder {
	private final static String SEQUENCE_VARIABLE = "SEQUENCE-VARIABLE";

	/* (non-Javadoc)
	 * @see whf.framework.util.var.VariableHolder#getAny()
	 */
	public Object getAny() {
		return Sequence.nextId(SEQUENCE_VARIABLE);
	}

	/* (non-Javadoc)
	 * @see whf.framework.util.var.VariableHolder#getHolder()
	 */
	public Map<String, Object> getHolder() {
		return null;
	}

	/* (non-Javadoc)
	 * @see whf.framework.util.var.VariableHolder#getVariable(java.lang.String)
	 */
	public Object getVariable(String key) {
		return Sequence.nextId(SEQUENCE_VARIABLE);
	}
	
	/* (non-Javadoc)
	 * @see whf.framework.util.var.VariableHolder#getScope()
	 */
	public VariableHolderScope getScope() {
		return VariableHolderScope.GLOBAL;
	}
}
